<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>艾绒银行登录页面</title>

	<%-- 静态包含 base标签、css样式、jQuery文件 --%>
	<%@ include file="/common/head.jsp"%>
	<script type="text/javascript">

		$(function (){

			$("#sub_btn").click(function () {
				var codeText = $("#code").val();

				//去掉验证码前后空格
				// alert("去空格前：["+codeText+"]")
				codeText = $.trim(codeText);
				// alert("去空格后：["+codeText+"]")

				if (codeText == null || codeText == "") {
					//4 提示用户
					$("span.errorMsg").text("验证码不能为空！");

					return false;
				}

				// 去掉错误信息
				$("span.errorMsg").text("");

			});

			$("#code_img").click(function(){
				this.src = "http://localhost:8080/kaptcha.jpg";
			})


		});


	</script>


</head>
<body>
		<br>
		<br>
		<br>
		<br>
			<div class="login_banner">
			
				<div id="l_content">
					<span class="login_word">欢迎登录</span>
				</div>
				
				<div id="content">
					<div class="login_form">
						<div class="login_box">
							<div class="tit">
								<h1>欢迎您来到网上银行</h1>
							</div>
							<div class="form">
								<form action="/userServlet" method="post">
									<input type="hidden" name="action" value="login" />
									<label>手机号：</label>
									<input class="itxt" type="text" placeholder="请输入手机号"
										   autocomplete="off" tabindex="1" name="phone"
										   value="${phone}" />
									<br />
									<br />
									<label>用户密码：</label>
									<input class="itxt" type="password" placeholder="请输入密码"
										   autocomplete="off" tabindex="1" name="password" />
									<br />
									<br />
									<label>验证码：</label>
									<input class="itxt" type="text" name="code" style="width: 150px;" id="code" />
									<img id="code_img" alt="" src="http://localhost:8080/kaptcha.jpg" style="float: right; margin-right: 40px;width: 90px;height: 40px;">
									<br />
									<br />
									<input type="submit" value="登录" id="sub_btn" />
								</form>
							</div>
							<br>
							<a href="user/regist.jsp">还未注册？</a>

						</div>
					</div>
				</div>
			</div>

		<%--静态包含页脚内容--%>
		<%@include file="/common/footer.jsp"%>
</body>
</html>